package Service.ServiceImpl;


import Dao.daoImpl.EmpDaoImpl;
import Model.Emp1;
import Service.UserService;

import java.sql.SQLException;
import java.util.Scanner;

public class EmpService implements UserService {
    EmpDaoImpl empDao = new EmpDaoImpl();

    //查询
    @Override
    public void showEmp() throws SQLException {
        System.out.println("业务逻辑开始了");
        empDao.showEmpDao();
    }

    //删除
    @Override
    public void delEmp(int empId) {
        try {
            empDao.delEmpDao(empId);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void updateEmp(int empId1) throws SQLException {
        empDao.updateEmpDao(empId1);
    }

    /*增加
                体现员工信息的逻辑层
                @param emp Array 数据集合 地址
                @param user 一条员工信息
             */
    @Override
    public void addEmp(Emp1 obj) {
        try {
            empDao.addEmpDao(obj);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }

    }
}
